<template>
  <s-layout title="合买大厅" navbar="custom" tabbar="/pages/index/index">
    <uni-view class="bgc">
      <uni-view class="navbar">
        <uni-view class="title">
          <uni-text style="font-size: 19px"><span>合买大厅</span></uni-text>
          <uni-view class="my">
            <image style="height: 16px;width: 16px;" src='@/static/gendan/youshang_person.png'></image>
          </uni-view>
        </uni-view>
      </uni-view>

      <!-- tab -->
      <su-sticky bgColor="#fff">
        <su-tabs :list="tabMaps" :scrollable="false" :current="state.currentTab" @change="onTabsChange">
        </su-tabs>
      </su-sticky>
    </uni-view>
  </s-layout>
</template>


<script setup>
  import {
    onLoad,
    onPageScroll,
    onReachBottom,
  } from '@dcloudio/uni-app';
  import {
    reactive,
  } from 'vue';
  import {
    resetPagination,
  } from '@/sheep/util';
  import SuTabs from '@/sheep/ui/su-tabs/su-tabs.vue';
  import SuSticky from '@/sheep/ui/su-sticky/su-sticky.vue';

  onPageScroll((e) => {
    state.scrollTop = e.scrollTop <= 100;
  });

  const state = reactive({
    totals: 0, // 累计推广订单（单）
    scrollTop: false,

    currentTab: 0,
    gameCurrentTab: 0,
    loadStatus: '',
    pagination: {
      list: [],
      total: 0,
      pageNo: 1,
      pageSize: 8,
    },
  });

  const tabMaps = [{
      name: '全部',
      value: 0,
    },
    {
      name: '双色球',
      value: 1,
    },
    {
      name: '福彩3D',
      value: 2,
    }, {
      name: '七乐彩',
      value: 3,
    }, {
      name: '快乐8',
      value: 4,
    }, {
      name: '冠亚军竞猜',
      value: 4,
    },
  ];

  // 切换选项卡
  function onTabsChange(e) {
    resetPagination(state.pagination);
    state.currentTab = e.index;
  }

  onLoad(() => {
  });

  // 加载更多
  function loadMore() {
    if (state.loadStatus === 'noMore') {
      return;
    }
    state.pagination.pageNo++;
  }

  // 上拉加载更多
  onReachBottom(() => {
    loadMore();
  });
</script>

<style>

  .content .list .foot .left .gd {
    width: 24%;
    display: flex;
    flex-wrap: row nowrap;
    flex-direction: column;
    align-items: center;
  }

  .content .list .foot .left .gd .f2 {
    border-radius: 7px;
    align-items: center;
    text-align: center;
    width: 60px;
    height: 30px;
    line-height: 30px;
    background-color: #ff3d00;
  }

  .content .list .foot .left .gd .f2 uni-text {
    color: #fff;
  }

  .content .list .foot .left .f1 p .gdRqOut .t2 {
    display: inline-block;
    height: 13px;
    background: url() 0 -15px repeat-x;
    background-size: 14px auto;
  }

  .content .list .foot .left .f1 p .gdRqOut {
    display: inline-block;
    text-align: left !important;
    width: 70px;
    height: 15px;
    background: url() repeat-x 0 2px;
    background-size: 14px auto;
  }

  uni-page-body {
    color: #303133;
    font-size: 14px;
  }

  .content .list {
    border-bottom: 1px solid #e5e5e5;
    padding: 10px;
  }

  .content .list .c {
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 8px;
  }

  .content .list .c uni-text {
    font-size: 14px;
    overflow: hidden;
    white-space: nowrap;
  }

  .content .list .top {
    display: flex;
    justify-content: space-between;
  }

  .content .list .top .left .l1 {
    margin-left: 10px;
    display: flex;
    flex-direction: column;
  }

  .content .list .top .left uni-image {
    width: 41px;
    height: 41px;
    border-radius: 25px;
  }

  .content .list .foot {
    margin-top: 10px;
    width: 96vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .content .list .foot .left {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    text-align: center;
  }

  .content .list .foot .left .f1 {
    width: 24%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .item .left {
    width: 6%;
    display: flex;
    align-items: center;
    width: 6%;
  }

  .item .right {
    width: 94%;
    display: flex;
  }

  .item .right .v1 {
    width: 25%;
    overflow: hidden;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    text-align: center;
  }

  .item .right uni-image {
    width: 41px;
    height: 41px;
    border: 1px solid #ff3d00;
    border-radius: 50%;
  }

  .item .right .v1 uni-text {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .navbar .title .my uni-image {
    width: 19px;
    vertical-align: middle;
  }

  .navbar .title .my {
    position: absolute;
    top: 0;
    right: 5%;
  }

  .navbar .title .help uni-image {
    width: 16px;
    vertical-align: middle;
  }

  .navbar .title .help {
    position: absolute;
    top: 0;
    left: 62%;
  }

  .navbar .title .fd uni-text {
    margin-left: 5px;
    color: #fff;
  }

  .navbar .title .fd uni-image {
    width: 16px;
    vertical-align: middle;
  }

  uni-image {
    display: inline-block;
  }

  uni-view,
  uni-text {
    box-sizing: border-box;
  }

  .bgc {
    width: 100vw;
    min-height: 100vh;
  }

  .navbar {
    background-color: #ff3d00;
    height: 50px;
    line-height: 50px;
    text-align: center;
  }

  .navbar .title {
    position: relative;
    color: #fff;
    font-size: 18px;
  }

  .navbar .title .search {
    position: absolute;
    top: 0;
    right: 21%;
    height: 50px;
  }

  uni-view {
    display: block;
  }

  .navbar .title .search uni-image {
    width: 19px;
    vertical-align: middle;
  }

  uni-image {
    display: inline-block;
  }

  uni-image {
    overflow: hidden;
    position: relative;
  }

  * {
    margin: 0;
    -webkit-tap-highlight-color: transparent;
  }


  uni-image > div {
    background-image: url();
    background-position: 0% 0%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }

  uni-image > div,
  uni-image > img {
    width: 100%;
    height: 100%;
  }

  * {
    margin: 0;
    -webkit-tap-highlight-color: transparent;
  }

  div {
    display: block;
    unicode-bidi: isolate;
  }
</style>